package com.yitong.profile.dao.impl;

import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import org.springframework.stereotype.Component;

import com.yitong.base.dao.api.ReadDao;
import com.yitong.base.dao.api.WriteDao;
import com.yitong.base.domain.DwzResult;
import com.yitong.base.domain.Page;
import com.yitong.profile.dao.api.UserMapper;
import com.yitong.profile.domain.User;

@Component
public class UserMapperImpl implements UserMapper{

	@Inject
	private ReadDao readDao;
	@Inject
	private WriteDao writeDao;

	private DwzResult dwzResult = new DwzResult();
	
	@SuppressWarnings("unchecked")
	@Override
	public Page<?> listUserWithPage(Map<String, Object> param, int pageNum,int pageSize) throws Exception {
		Page<User> page = null;
		try {
			page = readDao.findPage2("user.listUserWithPage", "user.count", param, pageNum, pageSize);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return page;
	}

	@Override
	public User showUserById(Map<String, Object> param) throws Exception {
		User user = null;
		user = (User) readDao.load("user.showUserById", param);
		return user;
	}
	
	
	@Override
	public int deleteByPrimaryKey(Long id) {
		return 0;
	}

	@Override
	public int insert(User record) {
		return 0;
	}

	@Override
	public int insertSelective(User record) {
		return 0;
	}

	@Override
	public User selectByPrimaryKey(Long id) {
		return null;
	}

	@Override
	public int updateByPrimaryKeySelective(User record) {
		return 0;
	}

	@Override
	public int updateByPrimaryKey(User record) {
		return 0;
	}

}
